<?php

class VideoController extends Controller_Site 
{
	public function indexAction()
	{
		$tagRowset = $this->getTagService()->getAllTags();
		$this->view->tags = $tagRowset->toArray();
		
		$videoRow = VideoService::getInstance()->getRandomVideo();
		$this->view->bigVideo = ContentListElement::fromRow($videoRow);
		
		$videoRowset = VideoService::getInstance()->getLatestVideos();
		$this->view->newVideos = ContentList::fromRowset($videoRowset);
		
		$videoRowset = VideoService::getInstance()->getPopularVideos();
		$this->view->popularVideos = ContentList::fromRowset($videoRowset);
	}
	
	public function tabAction()
	{
		$tagRowset = $this->getTagService()->getAllTags();
		$this->view->tags = $tagRowset->toArray();
		
		$videoRowset = VideoService::getInstance()->getMostCommentedVideous();
		$this->view->mostCommentedVideos = ContentList::fromRowset($videoRowset);
		
		$videoRowset = VideoService::getInstance()->getLatestVideos();
		$this->view->newVideos = ContentList::fromRowset($videoRowset);
	}
	
	public function videoAction()
	{
		
	}
}